package day12.abstractfactory.product1;

import day12.abstractfactory.AbstractFactory;

public class ShapeFactory implements AbstractFactory {

    public final static String SHAPE_CIRCLE = "CIRCLE";
    public final static String SHAPE_SQUARE = "SQUARE";
    public final static String SHAPE_RECTANGLE = "RECTANGLE";

    public Shape getShape(String shape) {
        switch (shape) {
            case SHAPE_CIRCLE: return new Circle();
            case SHAPE_SQUARE: return new Square();
            case SHAPE_RECTANGLE: return new Rectangle();
            default: return null;
        }
    }

}
